part of '../../repository.dart';

class _WebOneTimePurchasedItemTransactionDtoFactory {
  const _WebOneTimePurchasedItemTransactionDtoFactory._internal();

  static const _instance = _WebOneTimePurchasedItemTransactionDtoFactory._internal();

  factory _WebOneTimePurchasedItemTransactionDtoFactory() {
    return _instance;
  }

  _WebOneTimePurchasedItemTransactionDto fromJson(Map<String, dynamic> json) {
    final paymentSystem = json[_kWebTransactionPaymentSystemKey] as String;

    switch (paymentSystem) {
      case _kWebTransactionYookassaPaymentSystemValue:
        return _YookassaOneTimePurchasedItemTransactionDto.fromJson(json);
      default:
        throw UnimplementedError();
    }
  }
}
